bcdcf092486432e6c3c66797b1944920b0bd4797,platform/projectModel-impl/src/com/intellij/core/CoreProjectLoader.java,CoreProjectLoader,loadDirectoryProject,#MockProject#VirtualFile#,59

Before Change


  private static void loadDirectoryProject(MockProject project, VirtualFile projectDir) throws IOException, JDOMException,
                                                                                           InvalidDataException {
    VirtualFile dotIdea = projectDir.findChild(Project.DIRECTORY_STORE_FOLDER);
    if (dotIdea == null)
      throw new FileNotFoundException("Missing '" + Project.DIRECTORY_STORE_FOLDER + "' in " + projectDir.getPath());

    VirtualFile modulesXml = dotIdea.findChild("modules.xml");
    if (modulesXml == null)
      throw new FileNotFoundException("Missing 'modules.xml' in " + dotIdea.getPath());

    TreeMap<String, Element> storageData = loadStorageFile(project, modulesXml);
    final Element moduleManagerState = storageData.get("ProjectModuleManager");
    if (moduleManagerState == null) {
      throw new JDOMException("cannot find ProjectModuleManager state in modules.xml");
    }
    final CoreModuleManager moduleManager = (CoreModuleManager)ModuleManager.getInstance(project);
    moduleManager.loadState(moduleManagerState);

    VirtualFile miscXml = dotIdea.findChild("misc.xml");
    if (miscXml == null)
      throw new FileNotFoundException("Missing 'misc.xml' in " + dotIdea.getPath());
    storageData = loadStorageFile(project, miscXml);
    final Element projectRootManagerState = storageData.get("ProjectRootManager");
    if (projectRootManagerState == null) {
      throw new JDOMException("cannot find ProjectRootManager state in misc.xml");
    }
    ((ProjectRootManagerImpl) ProjectRootManager.getInstance(project)).loadState(projectRootManagerState);

    VirtualFile libraries = dotIdea.findChild("libraries");
    if (libraries != null) {

After Change


      if (projectRootManagerState == null) {
        throw new JDOMException("cannot find ProjectRootManager state in misc.xml");
      }
      ((ProjectRootManagerImpl)ProjectRootManager.getInstance(project)).loadState(projectRootManagerState);
    }

    VirtualFile libraries = dotIdea.findChild("libraries");